import { request } from './request.js'

/**
 * 获取用户的单元列表
 */
export function getUserUnits() {
  return request({
    url: '/api/assets/units/user/',
    method: 'get'
  })
}

/**
 * 获取单元详情
 */
export function getUnitDetail(unitId) {
  return request({
    url: `/api/assets/units/${unitId}/`,
    method: 'get'
  })
}

/**
 * 获取楼宇列表
 */
export function getBuildings() {
  return request({
    url: '/api/assets/buildings/',
    method: 'get'
  })
}

/**
 * 获取楼层列表
 */
export function getFloors(buildingId) {
  return request({
    url: `/api/assets/buildings/${buildingId}/floors/`,
    method: 'get'
  })
}

/**
 * 获取楼层下的单元列表
 */
export function getUnits(floorId) {
  return request({
    url: `/api/assets/floors/${floorId}/units/`,
    method: 'get'
  })
} 